#! /bin/sh

AUBIO_BUILDDIR=$PWD/build-cmake
#CMAKE_OPTS="-j 40"

function cleanup () {
    rm -rf $AUBIO_BUILDDIR
}

trap cleanup SIGINT SIGTERM

cleanup

cmake . -B $AUBIO_BUILDDIR
VERBOSE=1 cmake --build $AUBIO_BUILDDIR $CMAKE_OPTS || exit $?
make -C $AUBIO_BUILDDIR test $CMAKE_OPTS
